//
//  Image_Alignment.hpp
//  markerARLib
//
//  Created by CvidKal on 16/4/14.
//  Copyright © 2016年 CvidKal. All rights reserved.
//


//[1]Simon Baker and Iain Matthews:Lucas-Kanade 20 Years On: A Unifying Framework: Part 1

#ifndef Image_Alignment_hpp
#define Image_Alignment_hpp

#include <Eigen/Dense>
#include <type_traits>
#include <opencv2/opencv.hpp>
#include "Patch.hpp"
#include "Frame.hpp"


typedef Eigen::Matrix<float, 6, 1> Vector6f;


//The inverse compositional algorithm[1]

void align2D_Affine(
                    const Eigen::Vector2f &xy_template,
                    const Patch &patch_with_border,
                    Vector6f &p,
                    const cv::Mat &current_img,
                    int patch_size,
                    Eigen::Vector2f &xy_cur,
                    bool verbose = false
                    );



#endif /* Image_Alignment_hpp */
